<?php

include dirname(__FILE__).'/dbStructure.php';

while (list($table, $val) = each($dbStructure)) {
     $query .= "CREATE TABLE $dbTables[$table] (\n";
       while (list($column, $struct) = each($dbStructure[$table])) {
    if (preg_match('/index_\d+/',$column)) {
      $query .= "index " . $struct[0] . ",";
    } elseif (preg_match('/unique_\d+/',$column)) {
      $query .= "unique " . $struct[0] . ",";
    } else {
      $query .= "$column " . $struct[0] . ",";
    }
  }
  $query = substr($query,0,-1);
  $query .= "\n)";
echo $query . "<br />";
}

?>
